<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // \w  [a-zA-Z0-9_]
        var reg=/goo\w+gle/
        var str="goosdvssgle"
        console.log(reg.test(str));
        // \W   [^a-zA-Z0-9_]
        var reg=/goo\W+gle/
        var str="goo     gle"
        console.log(reg.test(str));
        // \d   [0-9]
        var reg=/goo\d+gle/
        var str="goo23524gle"
        console.log(reg.test(str));
        // \D   [^0-9]
        var reg=/goo\D+gle/
        var str="gooaonascngle"
        console.log(reg.test(str));
        // \s   空白
        var str="你 好 你 真 可爱"
        console.log(str.split(/\s/));
        // \S   非空白
        var str="你 好 你 真 可爱"
        console.log(str.split(/\S/));
    </script>
</body>
</html>